package com.wuyou.sso.common.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 菜单
 *
 * @author lishangbu
 * @date 2021/1/22
 */
@Data
//@ApiModel(value = "菜单")
@TableName(autoResultMap = true)
public class Menu implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 菜单ID
     */
    @TableId(type = IdType.ASSIGN_ID)
//    @ApiModelProperty(value = "菜单id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;

    /**
     * 菜单名称
     */
//    @NotBlank(message = "菜单名称不能为空")
//    @ApiModelProperty(value = "菜单名称", required = true)
    private String name;

    /**
     * 菜单权限标识
     */
//    @ApiModelProperty(value = "菜单权限标识")
    private String permission;

    /**
     * 父菜单ID
     */
//    @NotNull(message = "父级菜单不能为空")
//    @ApiModelProperty(value = "菜单父id", required = true)
    @JsonSerialize(using = ToStringSerializer.class)
    private Long parentId;

    /**
     * 图标
     */
//    @ApiModelProperty(value = "菜单图标")
    private String icon;

    /**
     * 前端路由标识路径，默认和 comment 保持一致 过期
     */
//    @ApiModelProperty(value = "前端路由标识路径")
    private String path;

    /**
     * 排序值
     */
//    @ApiModelProperty(value = "排序值")
    private Integer sort;
    /**
     * 元数据
     */
//    @ApiModelProperty(value = "元数据")
    @TableField(typeHandler = JacksonTypeHandler.class)
    private Object meta;

    /**
     * 菜单类型
     */
//    @NotNull(message = "菜单类型不能为空")
//    @ApiModelProperty(value = "菜单类型", required = true)
    private Integer type;

    /**
     * 创建时间
     */
//    @ApiModelProperty(value = "创建时间")
    private LocalDateTime createTime;

    /**
     * 更新时间
     */
//    @ApiModelProperty(value = "更新时间")
    private LocalDateTime updateTime;

    /**
     * 菜单是否展示
     */
//    @ApiModelProperty(value = "菜单是否展示", required = true)
    private Boolean isShow;
}
